.class Lcom/waiqin365/lightapp/im/contactlist/aa;
.super Landroid/os/Handler;


# instance fields
.field final synthetic a:Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;


# direct methods
.method constructor <init>(Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/lightapp/im/contactlist/aa;->a:Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;

    invoke-direct {p0}, Landroid/os/Handler;-><init>()V

    return-void
.end method


# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .locals 9

    const/4 v2, 0x0

    invoke-super {p0, p1}, Landroid/os/Handler;->handleMessage(Landroid/os/Message;)V

    iget v0, p1, Landroid/os/Message;->what:I

    packed-switch v0, :pswitch_data_0

    :goto_0
    return-void

    :pswitch_0
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Lcom/waiqin365/lightapp/im/a/a/e;

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Lcom/waiqin365/lightapp/im/a/a/e;->b()Z

    move-result v1

    if-eqz v1, :cond_0

    iget-object v1, v0, Lcom/waiqin365/lightapp/im/a/a/e;->d:Ljava/lang/String;

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_0

    new-instance v1, Lcom/waiqin365/lightapp/im/contactlist/ab;

    invoke-direct {v1, p0, v0}, Lcom/waiqin365/lightapp/im/contactlist/ab;-><init>(Lcom/waiqin365/lightapp/im/contactlist/aa;Lcom/waiqin365/lightapp/im/a/a/e;)V

    invoke-virtual {v1}, Lcom/waiqin365/lightapp/im/contactlist/ab;->start()V

    goto :goto_0

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/lightapp/im/contactlist/aa;->a:Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;->e(Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;)Landroid/content/Context;

    move-result-object v0

    iget-object v1, p0, Lcom/waiqin365/lightapp/im/contactlist/aa;->a:Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;

    invoke-static {v1}, Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;->f(Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;)Landroid/content/Context;

    move-result-object v1

    const v2, 0x7f0802ee

    invoke-virtual {v1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/waiqin365/lightapp/view/dk;->a(Landroid/content/Context;Ljava/lang/CharSequence;)V

    goto :goto_0

    :pswitch_1
    iget-object v0, p0, Lcom/waiqin365/lightapp/im/contactlist/aa;->a:Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;

    invoke-virtual {v0}, Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;->dismissProgressDialog()V

    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Lcom/waiqin365/lightapp/im/a/a/f;

    invoke-virtual {v0}, Lcom/waiqin365/lightapp/im/a/a/f;->b()Z

    move-result v1

    if-eqz v1, :cond_2

    iget-object v1, v0, Lcom/waiqin365/lightapp/im/a/a/f;->d:Ljava/lang/String;

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_2

    const-string/jumbo v3, ""

    iget-object v1, p0, Lcom/waiqin365/lightapp/im/contactlist/aa;->a:Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;

    iget-object v4, p0, Lcom/waiqin365/lightapp/im/contactlist/aa;->a:Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;

    iget-object v4, v4, Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;->e:Ljava/util/List;

    invoke-static {v1, v4}, Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;->b(Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;Ljava/util/List;)Ljava/util/List;

    move-result-object v1

    new-array v4, v2, [Ljava/lang/String;

    invoke-interface {v1, v4}, Ljava/util/List;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v1

    check-cast v1, [Ljava/lang/String;

    const-string/jumbo v4, "/chatgroups"

    new-instance v5, Ljava/util/HashMap;

    invoke-direct {v5}, Ljava/util/HashMap;-><init>()V

    const-string/jumbo v6, "Authorization"

    new-instance v7, Ljava/lang/StringBuilder;

    invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v8, "Bearer "

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    iget-object v0, v0, Lcom/waiqin365/lightapp/im/a/a/f;->d:Ljava/lang/String;

    invoke-virtual {v7, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v5, v6, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    new-instance v6, Lorg/json/JSONObject;

    invoke-direct {v6}, Lorg/json/JSONObject;-><init>()V

    :try_start_0
    const-string/jumbo v0, "groupname"

    iget-object v7, p0, Lcom/waiqin365/lightapp/im/contactlist/aa;->a:Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;

    iget-object v7, v7, Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;->d:Ljava/lang/String;

    invoke-virtual {v6, v0, v7}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v0, "desc"

    invoke-virtual {v6, v0, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v0, "public"

    const/4 v3, 0x1

    invoke-virtual {v6, v0, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    const-string/jumbo v0, "maxusers"

    const/16 v3, 0x1f4

    invoke-virtual {v6, v0, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    const-string/jumbo v0, "approval"

    const/4 v3, 0x0

    invoke-virtual {v6, v0, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Z)Lorg/json/JSONObject;

    const-string/jumbo v0, "owner"

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v3

    invoke-virtual {v3}, Lcom/hyphenate/chat/EMClient;->getCurrentUser()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v6, v0, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    new-instance v3, Lorg/json/JSONArray;

    invoke-direct {v3}, Lorg/json/JSONArray;-><init>()V

    if-eqz v1, :cond_1

    array-length v0, v1

    if-lez v0, :cond_1

    move v0, v2

    :goto_1
    array-length v2, v1

    if-ge v0, v2, :cond_1

    aget-object v2, v1, v0

    invoke-virtual {v3, v2}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;

    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    :cond_1
    const-string/jumbo v0, "members"

    invoke-virtual {v6, v0, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_2
    new-instance v0, Lcom/waiqin365/lightapp/im/a/a/b;

    invoke-virtual {v6}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v4, v5, v1}, Lcom/waiqin365/lightapp/im/a/a/b;-><init>(Ljava/lang/String;Ljava/util/Map;Ljava/lang/String;)V

    new-instance v1, Lcom/waiqin365/lightapp/im/a/b;

    iget-object v2, p0, Lcom/waiqin365/lightapp/im/contactlist/aa;->a:Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;

    iget-object v2, v2, Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;->f:Landroid/os/Handler;

    invoke-direct {v1, v2, v0}, Lcom/waiqin365/lightapp/im/a/b;-><init>(Landroid/os/Handler;Lcom/waiqin365/lightapp/im/a/c;)V

    invoke-virtual {v1}, Lcom/waiqin365/lightapp/im/a/b;->start()V

    goto/16 :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_2

    :cond_2
    iget-object v0, p0, Lcom/waiqin365/lightapp/im/contactlist/aa;->a:Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;->g(Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;)Landroid/content/Context;

    move-result-object v0

    iget-object v1, p0, Lcom/waiqin365/lightapp/im/contactlist/aa;->a:Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;

    invoke-static {v1}, Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;->h(Lcom/waiqin365/lightapp/im/contactlist/GroupPickContactsListSelectByDepartmentActivity;)Landroid/content/Context;

    move-result-object v1

    const v2, 0x7f080615

    invoke-virtual {v1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/waiqin365/lightapp/view/dk;->a(Landroid/content/Context;Ljava/lang/CharSequence;)V

    goto/16 :goto_0

    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method
